﻿@inherits Umbraco.Web.Mvc.UmbracoTemplatePage

@{
    var homePage = CurrentPage.AncestorsOrSelf(1).First();
    var mainMenuContainer = homePage.MenusContainer.First();
    var menuItems = mainMenuContainer.Menu.Where("UmbracoNaviHide == false");
    var menuContainers = mainMenuContainer.MenusContainer.Where("UmbracoNaviHide == false");
}

<!-- Archives -->
<ul class="root-menu">
    @foreach (var menuItem in menuContainers)
    {
        var title = string.IsNullOrWhiteSpace(menuItem.Title)  ? menuItem.Name : menuItem.Title;
        <li class="title-background" >
            <a style="background-image:url(@menuItem.image)" href="@menuItem.Url">@title</a>
        </li>
    }
    @foreach (var menuItem in menuItems)
    {
        var title = string.IsNullOrWhiteSpace(menuItem.Title)  ? menuItem.Name : menuItem.Title;
        <li class="title-background">
            <a style="background-image:url(@menuItem.image)" href="@menuItem.Url">@title</a>
        </li>
    }
</ul>
<!-- /Archives -->
